<?php

use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m181024_012548_ADD_FIELD_USER
 */
class m181024_012548_ADD_FIELD_USER extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('{{user}}', 'name', Schema::TYPE_STRING. "(32) NULL COMMENT '中文名' AFTER email ");

        $this->addColumn('{{user}}', 'code', Schema::TYPE_STRING. "(32) NULL COMMENT '简称' AFTER name ");

        $this->addColumn('{{user}}', 'company', Schema::TYPE_STRING. "(128) NULL COMMENT '公司' AFTER code ");
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m181024_012548_ADD_FIELD_USER cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m181024_012548_ADD_FIELD_USER cannot be reverted.\n";

        return false;
    }
    */
}
